import request from '@/utils/request';

/**
 * 会员列表
 */
export async function levelList(data) {
  const res = await request.post('/level/levelList', data);
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
// 添加会员等级
export async function addLevel(data) {
  const res = await request.post('/level/addLevel', data);
  if (res.data.code === 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.message));
}

// 编辑会员等级
export async function editLevel(data) {
  const res = await request.post('/level/editLevel', data);
  if (res.data.code === 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.message));
}
